package com.example.controller;

import com.example.base.response.Result;
import com.example.entity.Calender;
import com.example.service.CalenderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@CrossOrigin
@RestController
@RequestMapping("/calender")
public class CalenderController {
    @Autowired
    private CalenderService calenderService;
    @GetMapping
    public Result findAll(){
        return Result.success(calenderService.findAll());
    }
    @PostMapping("/save")
    public  Result save(@RequestBody Calender calender){

        calenderService.add(calender);

        return Result.success();
    }

}
